package com.vstudy.zx.dao.provider;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.jdbc.SQL;

public class OutlineDaoProvider {
    public String selectByGradeSubject(@Param("grade_id") Long grade_id, @Param("subject_id") Long subject_id) {
        String sql = new SQL() {{
            SELECT("*");
            FROM("tb_outline");
            if (grade_id != null) {
                WHERE("grade_id=#{grade_id}");
            }
            if (subject_id != null) {
                WHERE("subject_id=#{subject_id}");
            }
        }}.toString();
        return sql;
    }
}
